#ifndef SOBOL_SEQUENCE_GENERATOR_H
#define SOBOL_SEQUENCE_GENERATOR_H

namespace RayTracePro
{
	class SobolGenerator
	{
	private:
		unsigned int lastX, lastY, lastZ;
		unsigned int xId, yId, zId;
		static const double inv2p32;
		int FirstZeroBitFromRight(unsigned int x);
	public:
		SobolGenerator(unsigned int seedx = 0, unsigned int seedy = 0, unsigned int seedz = 0)
		{
			lastX = seedx;
			lastY = seedy;
			lastZ = seedz;
			xId = yId = zId = 0;
		}
		double NextX();
		double NextY();
		double NextZ();
	};
}

#endif